home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-16 | 2.7 KB | 85 lines | [TEXT/MPS ] |
- #----------------------------------------------------------------------------------------------------------------------------------------------------
- # Quit•Mine
- # MPW Shell Script
- # Original by Stuart Davidson
- # Changes by Gina Cherry • August 16, 1991
- # Copyright: © 1991 by Apple Computer, Inc., all rights reserved.
- #
- # Usage: Quit•Mine is automatically executed by the Quit script when the user quits MPW
- #
- # Function:
- # Quit•Mine prompts the user to back up his/her files when exiting MPW, and executes
- # the backup commands.
- #----------------------------------------------------------------------------------------------------------------------------------------------------
-
- # Don't exit on error.
- Set Exit 0
-
- # Set source and destination directories.
- # Note: these variables should be changed to correspond to the user's directories.
- Set From "{Source}"
- Set To "Backup:"
-
- # Close help file; don't want to save changes.
- Close -n "{MPW}Help Folder:Help" ∑∑ ≥ Dev:Null
-
- # Close all windows. Request user confirmation before closing.
- Close -a
-
- Save "{Worksheet}"
-
- Begin
-
- # Eject floppy disk currently in drive 1.
- Eject 1
-
- # Prompt user to insert backup disk.
- Confirm "Insert backup disk."
-
- # OK is selected.
- If {Status}== 0
-
- # In this example, Backup generates duplicate commands for all text files in the source
- # directory which do not exist in the destination directory, or which have been more modified
- # more recently than the version in the destination. Backup processes all subdirectories in
- # the source directory recursively. All commands generated by Backup are redirected to the
- # temporary file "{MPW}BackupTemp". If the source or the destination is a floppy, Backup
- # generates a command to eject your disk following the duplicate commands.
- #
- # Note: These options can be changed to suit the user's preference. See the MPW Command
- # Reference for more information on the Backup command.
- Backup ∂
- -from "{From}" ∂
- -to "{To}" ∂
- -a -c -e -r -t TEXT ∂
- > "{MPW}BackupTemp"
-
- # If Backup is not successful, write error message, delete temporary file, and exit script.
- If {Status} != 0
- Echo '### Backup failed.'
- Delete "{MPW}BackupTemp"
- Exit 1
- End
-
- # Execute the commands generated by Backup, highlighting each command as it is executed.
- DoIt "{MPW}BackupTemp" ≥ Dev:Null
-
- # If backup commands cannot be executed, write error message, delete temporary file, and
- # exit script.
- If {Status} != 0
- Echo '### Backup failed.'
- Delete "{MPW}BackupTemp"
- Exit 1
- End
-
- # Delete the temporary file.
- Delete "{MPW}BackupTemp"
-
- # Cancel is selected.
- Else
- Echo "# {0}: Backup cancelled."
-
- End
- End ∑∑ "{Worksheet}"
-
-